package com.xinzhi.service.impl;

import com.xinzhi.dao.UserMapper;
import com.xinzhi.model.User;
import com.xinzhi.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements IUserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public User logincheck(User user) {
        System.out.println("登录");
        return userMapper.logincheck(user);
    }

    @Override
    public int register(User user) {
        System.out.println("注册");
        return userMapper.register(user);
    }

    @Override
    public boolean repetition(String phone) {
        User user = new User();
        user.setPhone(phone);
        User repetition = userMapper.repetition(phone);
        if (repetition!=null){
            return false;
        }
        return true;
    }
}
